package com.index.ylr.framework.rabbitmq.listener;

import com.index.ylr.framework.rabbitmq.po.TestPo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;


/**
 * Created by IntelliJ IDEA.
 *
 * @author wei
 * date: 2022-06-12 10:43:23
 * className: TestListener
 * version: 1.0
 * description:
 */
@Component
public class TestListener {

    private static final Logger log = LoggerFactory.getLogger(TestListener.class);

    @RabbitListener(queues = { "retry.queue" })
    public void blogCommentLikeMessage(TestPo testPo) {
        log.info("获取到消息对象: {}", testPo);

        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }

        int i = 10 / 0;

    }
}
